<template>
  <div class="scheduleList-container">
    <div class="scheduleList-content">
      <page-header
        @add="add"
        type="orgPersonnelList"
        @reset="resetSeach"
        @searchChange="searchData"
      ></page-header>
      <pagination-table
        ref="ptable"
        :tableData="pageData.listData"
        @pagination="paginaChange"
      >
        <XMTableColumn label="班次名称" prop="scheduleName"></XMTableColumn>
        <XMTableColumn label="时间" prop="workTiem"></XMTableColumn>
        <XMTableColumn label="操作" min-width="160">
          <template #default="scope">
            <el-button size="small" type="primary" @click="edit(scope.row)">
              编辑
            </el-button>
            <el-button size="small" type="primary" @click="del(scope.row)">
              删除
            </el-button>
          </template>
        </XMTableColumn>
      </pagination-table>
    </div>
    <el-dialog title="修改序号" v-model="isVisble" width="30%">
      <el-form
        ref="formRef"
        :rules="{
          sequence: [
            {
              required: true,
              type: 'number',
              message: '请输入数字类型',
              trigger: 'change',
            },
          ],
        }"
        :model="form"
      >
        <el-form-item label="修改序号" label-width="80px" prop="sequence">
          <el-input
            v-model.number="form.sequence"
            placeholder="请输入要修改的序列号"
          ></el-input>
        </el-form-item>
      </el-form>
      <template #footer>
        <span class="dialog-footer">
          <el-button @click="isVisble.value = false">取 消</el-button>
          <el-button type="primary" @click="onSubmit">确 定</el-button>
        </span>
      </template>
    </el-dialog>
  </div>
</template>
<script>
  export default {
    name: 'scheduleList',
    setup() {
      const loadData = function () {
        console.log('加载数据')
      }
      const edit = function () {
        console.log('点击编辑按钮')
      }
      const del = function () {
        console.log('点击删除按钮')
      }
      return {
        edit,
        del,
        loadData,
      }
    },
  }
</script>

<style lang="scss" scoped>
  .scheduleList-container {
    margin: 32px;

    .scheduleList-content {
      background-color: white;
      overflow: hidden;

      .el-divider--horizontal {
        margin: 12px 2px;
      }
    }
  }
</style>
